<template>
  <div>
    <iframe :style="{height:pdfheight+'px'}"  v-if="pdfsrc" class="pdf-iframe" :src="pdfsrc">
    </iframe>
    <button @click="closeHidder" class="pdfclose">关闭</button>
  </div>
  
</template>

<script>
export default {
 
  data () {
    return {
      pdfsrc:'',
      pdfheight:''
    }
  },
  mounted () {
    this.pdfsrc =   decodeURIComponent( this.$route.params.pdf) 
   this.pdfheight = document.body.clientHeight
  },
  methods: {
    closeHidder(){
      this.$router.back()
    }
  }
}
</script>

<style scoped>
.pdf-iframe{
  width: 100%;
  height: 600px;
}
.pdfclose{
  position: absolute;
  top: 20px;
  right: 43px;
  font-size: 18px;
}
</style>